package com.vcredit.creditcat.service.product.outer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vcredit.creditcat.dto.product.outer.CustProductApplyDto;
import com.vcredit.creditcat.model.CustProductApply;
import com.vcredit.creditcat.service.CustProductApplyService;
import com.vcredit.creditcat.util.BeanUtil;
import com.vcredit.framework.annotation.Log;

@Service
public class ProductApplyCallbackService {
	
	@Autowired
	private CustProductApplyService custProductApplyService;
	
	@Log
	public Boolean creditCallback(CustProductApplyDto custProductApplyDto) {
		CustProductApply custProductApply = custProductApplyService.findByCustAndProduct(custProductApplyDto.getCustId(), 
				custProductApplyDto.getProductId());
//		custProductApply.setAuditResult(custProductApplyDto.getAuditResult());
//		custProductApply.setMaxAmount(custProductApplyDto.getMaxAmount());
//		custProductApply.setMinAmount(custProductApplyDto.getMinAmount());
//		custProductApply.setRangeAmount(custProductApplyDto.getRangeAmount());
//		custProductApply.setLoanTerm(custProductApplyDto.getLoanTerm());
//		custProductApply.setLoanTermType(custProductApplyDto.getLoanTermType());
//		custProductApply.setLoanRate(custProductApplyDto.getLoanRate());
//		custProductApply.setCreditExpiretime(custProductApplyDto.getCreditExpiretime());
//		custProductApply.setServiceRate(custProductApplyDto.getServiceRate());
//		custProductApply.setCuttingAmount(custProductApplyDto.getCuttingAmount());
		
		CustProductApply copy = new CustProductApply();
		BeanUtil.copy(custProductApplyDto, copy);
		copy.setApplyId(custProductApply.getApplyId());
		custProductApplyService.update(copy);
		return true;
	}

}
